---
title: Publishing Prompts
description: Deploy your version-controlled prompts as API endpoints via the AI Gateway.
---

Once you have iterated and tested your prompt using the [Prompt Manager](/guides/prompt-manager/overview) and [Playground](/guides/prompt-manager/playground), the next step is to make it available to your applications. Latitude allows you to deploy the published version of your prompts as stable API endpoints through the AI Gateway.

## The AI Gateway Concept

The AI Gateway acts as a proxy between your application and the underlying AI models configured for your prompt. When you publish a new version of a prompt in Latitude:

1.  The AI Gateway endpoint associated with that prompt is automatically updated to use the newly published version.
2.  Your application continues calling the same stable endpoint URL.
3.  The gateway routes the request to the correct prompt version and configured model provider.

This decouples your application deployment cycle from your prompt iteration cycle.

## Publishing a Prompt Version

1.  Ensure your desired prompt changes are saved in the current [draft version](/guides/prompt-manager/version-control).
2.  Thoroughly test the draft in the [Playground](/guides/prompt-manager/playground) and potentially running [experiments with evaluations](/guides/evaluations/running-evaluations#running-evaluations-on-datasets-batch-mode).
3.  Click the "Publish" button within the prompt editor or version management interface.
![Publish Prompt Button](/assets/publish-button.png)
4.  Add a descriptive version note (e.g., "Added handling for Spanish language queries").
![Publish Prompt modal](/assets/publish-modal.png)
5.  Confirm the publication.

Your draft is now the new "Published" version.

## Referencing Deployed Endpoints

After publishing, your prompt is accessible via a unique, stable API endpoint.

### Finding the Endpoint URL

- Navigate to the prompt in the Latitude UI.
- Click the **Deploy this prompt** button on the right top corner of the prompt editor.
![Deploy button](/assets/deploy-button.png)
- Copy the endpoint URL under the HTTP API section.

### Using the Endpoint

There are two main ways to interact with the deployed prompt endpoint:

1.  **Latitude SDK (Recommended)**:

    - Use the `latitude.run('your_prompt_id', { parameters: {...} })` method (or equivalent) in our [Python](/guides/sdk/python) or [TypeScript](/guides/sdk/typescript) SDKs.
    - The SDK handles authentication and communication with the correct endpoint based on the prompt ID.
    - This abstracts away the raw HTTP call.

2.  **Direct HTTP API Call**:
    - Make a POST request directly to the endpoint URL provided in the UI.
    - Include necessary authentication headers (API Key). See [API Access](/guides/api/api-access).
    - Send parameters in the request body.
    - Refer to the [API Reference](/guides/api/reference) for detailed request/response formats.

## Auto-Updating Prompts (No Redeployment Needed)

The key benefit of this system is that when you publish a new version of a prompt in Latitude:

- The AI Gateway endpoint instantly starts using the new version.
- **You do not need to change any code or redeploy your application.**

Your application continues to call the same endpoint URL or use the same prompt ID with the SDK, and it automatically benefits from the updated prompt logic and configuration.

## Next Steps

- Integrate using the [Latitude SDKs](/guides/sdk/typescript)
- Learn about the [HTTP API](/guides/api/reference)
- Set up [API Access Keys](/guides/api/api-access)
